home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / mach / amiga / tools / gcc040pd.lha / as.info-1 < prev    next >
Encoding:
GNU Info File  |  1992-09-30  |  48.9 KB  |  1,351 lines

  1. This is Info file as.info, produced by Makeinfo-1.43 from the input
  2. file as-680x0.texinfo.
  3.  
  4.    This file documents the GNU Assembler "as".
  5.  
  6.    Copyright (C) 1991 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the section entitled "GNU General Public License" is included
  15. exactly as in the original, and provided that the entire resulting
  16. derived work is distributed under the terms of a permission notice
  17. identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the section entitled "GNU General Public
  22. License" may be included in a translation approved by the Free
  23. Software Foundation instead of in the original English.
  24.  
  25. 
  26. File: as.info,  Node: Top,  Next: Overview,  Prev: (dir),  Up: (dir)
  27.  
  28.    This file is a user guide to the GNU assembler `as'.  This version
  29. of the file describes `as' configured to generate code for Motorola
  30. 680x0 architectures.
  31.  
  32. * Menu:
  33.  
  34. * Overview::            Overview
  35. * Invoking::            Command-Line Options
  36. * Syntax::            Syntax
  37. * Sections::            Sections and Relocation
  38. * Symbols::            Symbols
  39. * Expressions::            Expressions
  40. * Pseudo Ops::            Assembler Directives
  41. * M68K-Dependent::     Machine Dependent Features
  42. * Copying::            GNU GENERAL PUBLIC LICENSE
  43. * Index::                       Index
  44.  
  45. 
  46. File: as.info,  Node: Overview,  Next: Invoking,  Prev: Top,  Up: Top
  47.  
  48. Overview
  49. ********
  50.  
  51.    Here is a brief summary of how to invoke `as'.  For details, *note
  52. Comand-Line Options: Invoking..
  53.  
  54.        as [ -a | -al | -as ] [ -D ] [ -f ]
  55.         [ -I PATH ] [ -k ] [ -L ]
  56.         [ -o OBJFILE ] [ -R ] [ -v ] [ -w ]
  57.         [ -l ] [ -mc68000 | -mc68010 | -mc68020 ]
  58.         [ -- | FILES ... ]
  59.  
  60. `-a | -al | -as'
  61.      Turn on assembly listings; `-al', listing only, `-as', symbols
  62.      only, `-a', everything.
  63.  
  64. `-D'
  65.      This option is accepted only for script compatibility with calls
  66.      to other assemblers; it has no effect on `as'.
  67.  
  68. `-f'
  69.      "fast"--skip preprocessing (assume source is compiler output)
  70.  
  71. `-I PATH'
  72.      Add PATH to the search list for `.include' directives
  73.  
  74. `-k'
  75.      Issue warnings when difference tables altered for long
  76.      displacements.
  77.  
  78. `-L'
  79.      Keep (in symbol table) local symbols, starting with `L'
  80.  
  81. `-o OBJFILE'
  82.      Name the object-file output from `as'
  83.  
  84. `-R'
  85.      Fold data section into text section
  86.  
  87. `-v'
  88.      Announce `as' version
  89.  
  90. `-W'
  91.      Suppress warning messages
  92.  
  93. `-l'
  94.      Shorten references to undefined symbols, to one word instead of
  95.      two
  96.  
  97. `-mc68000 | -mc68010 | -mc68020'
  98.      Specify what processor in the 68000 family is the target (default
  99.      68020)
  100.  
  101. `-- | FILES ...'
  102.      Standard input, or source files to assemble
  103.  
  104. * Menu:
  105.  
  106. * Manual::            Structure of this Manual
  107. * GNU Assembler::        as, the GNU Assembler
  108. * Object Formats::        Object File Formats
  109. * Command Line::        Command Line
  110. * Input Files::            Input Files
  111. * Object::            Output (Object) File
  112. * Errors::            Error and Warning Messages
  113.  
  114. 
  115. File: as.info,  Node: Manual,  Next: GNU Assembler,  Prev: Overview,  Up: Overview
  116.  
  117. Structure of this Manual
  118. ========================
  119.  
  120.    This manual is intended to describe what you need to know to use
  121. GNU `as'.  We cover the syntax expected in source files, including
  122. notation for symbols, constants, and expressions; the directives that
  123. `as' understands; and of course how to invoke `as'.
  124.  
  125.    We also cover special features in the Motorola 680x0 configuration
  126. of `as', including assembler directives.
  127.  
  128.    On the other hand, this manual is *not* intended as an introduction
  129. to programming in assembly language--let alone programming in general! 
  130. In a similar vein, we make no attempt to introduce the machine
  131. architecture; we do *not* describe the instruction set, standard
  132. mnemonics, registers or addressing modes that are standard to a
  133. particular architecture.
  134.  
  135. 
  136. File: as.info,  Node: GNU Assembler,  Next: Object Formats,  Prev: Manual,  Up: Overview
  137.  
  138. as, the GNU Assembler
  139. =====================
  140.  
  141.    GNU `as' is really a family of assemblers.  This manual describes
  142. `as', a member of that family which is configured for the Motorola
  143. 680x0 architectures.  If you use (or have used) the GNU assembler on
  144. one architecture, you should find a fairly similar environment when
  145. you use it on another architecture.  Each version has much in common
  146. with the others, including object file formats, most assembler
  147. directives (often called "pseudo-ops)" and assembler syntax.
  148.  
  149.    `as' is primarily intended to assemble the output of the GNU C
  150. compiler `gcc' for use by the linker `ld'.  Nevertheless, we've tried
  151. to make `as' assemble correctly everything that the native assembler
  152. would.  This doesn't mean `as' always uses the same syntax as another
  153. assembler for the same architecture; for example, we know of several
  154. incompatible versions of 680x0 assembly language syntax.
  155.  
  156.    Unlike older assemblers, `as' is designed to assemble a source
  157. program in one pass of the source file.  This has a subtle impact on
  158. the `.org' directive (*note `.org': Org.).
  159.  
  160. 
  161. File: as.info,  Node: Object Formats,  Next: Command Line,  Prev: GNU Assembler,  Up: Overview
  162.  
  163. Object File Formats
  164. ===================
  165.  
  166.    The GNU assembler can be configured to produce several alternative
  167. object file formats.  For the most part, this does not affect how you
  168. write assembly language programs; but directives for debugging symbols
  169. are typically different in different file formats.  *Note Symbol
  170. Attributes: Symbol Attributes.  On the Motorola 680x0, `as' is
  171. configured to produce `a.out' format object files.
  172.  
  173. 
  174. File: as.info,  Node: Command Line,  Next: Input Files,  Prev: Object Formats,  Up: Overview
  175.  
  176. Command Line
  177. ============
  178.  
  179.    After the program name `as', the command line may contain options
  180. and file names.  Options may appear in any order, and may be before,
  181. after, or between file names.  The order of file names is significant.
  182.  
  183.    `--' (two hyphens) by itself names the standard input file
  184. explicitly, as one of the files for `as' to assemble.
  185.  
  186.    Except for `--' any command line argument that begins with a hyphen
  187. (`-') is an option.  Each option changes the behavior of `as'.  No
  188. option changes the way another option works.  An option is a `-'
  189. followed by one or more letters; the case of the letter is important. 
  190.  All options are optional.
  191.  
  192.    Some options expect exactly one file name to follow them.  The file
  193. name may either immediately follow the option's letter (compatible
  194. with older assemblers) or it may be the next command argument (GNU
  195. standard).  These two command lines are equivalent:
  196.  
  197.      as -o my-object-file.o mumble.s
  198.      as -omy-object-file.o mumble.s
  199.  
  200. 
  201. File: as.info,  Node: Input Files,  Next: Object,  Prev: Command Line,  Up: Overview
  202.  
  203. Input Files
  204. ===========
  205.  
  206.    We use the phrase "source program", abbreviated "source", to
  207. describe the program input to one run of `as'.  The program may be in
  208. one or more files; how the source is partitioned into files doesn't
  209. change the meaning of the source.
  210.  
  211.    The source program is a concatenation of the text in all the files,
  212. in the order specified.
  213.  
  214.    Each time you run `as' it assembles exactly one source program. 
  215. The source program is made up of one or more files.  (The standard
  216. input is also a file.)
  217.  
  218.    You give `as' a command line that has zero or more input file
  219. names.  The input files are read (from left file name to right).  A
  220. command line argument (in any position) that has no special meaning is
  221. taken to be an input file name.
  222.  
  223.    If you give `as' no file names it attempts to read one input file
  224. from the `as' standard input, which is normally your terminal.  You
  225. may have to type ctl-D to tell `as' there is no more program to
  226. assemble.
  227.  
  228.    Use `--' if you need to explicitly name the standard input file in
  229. your command line.
  230.  
  231.    If the source is empty, `as' will produce a small, empty object
  232. file.
  233.  
  234. Filenames and Line-numbers
  235. --------------------------
  236.  
  237.    There are two ways of locating a line in the input file (or files)
  238. and either may be used in reporting error messages.  One way refers to
  239. a line number in a physical file; the other refers to a line number in
  240. a "logical" file.  *Note Error and Warning Messages: Errors.
  241.  
  242.    "Physical files" are those files named in the command line given to
  243. `as'.
  244.  
  245.    "Logical files" are simply names declared explicitly by assembler
  246. directives; they bear no relation to physical files.  Logical file
  247. names help error messages reflect the original source file, when `as'
  248. source is itself synthesized from other files.  *Note `.app-file':
  249. App-File.
  250.  
  251. 
  252. File: as.info,  Node: Object,  Next: Errors,  Prev: Input Files,  Up: Overview
  253.  
  254. Output (Object) File
  255. ====================
  256.  
  257.    Every time you run `as' it produces an output file, which is your
  258. assembly language program translated into numbers.  This file is the
  259. object file, named `a.out' unless you tell `as' to give it another
  260. name by using the `-o' option.  Conventionally, object file names end
  261. with `.o'.  The default name of `a.out' is used for historical
  262. reasons:  older assemblers were capable of assembling self-contained
  263. programs directly into a runnable program.
  264.  
  265.    The object file is meant for input to the linker `ld'.  It contains
  266. assembled program code, information to help `ld' integrate the
  267. assembled program into a runnable file, and (optionally) symbolic
  268. information for the debugger.
  269.  
  270. 
  271. File: as.info,  Node: Errors,  Prev: Object,  Up: Overview
  272.  
  273. Error and Warning Messages
  274. ==========================
  275.  
  276.    `as' may write warnings and error messages to the standard error
  277. file (usually your terminal).  This should not happen when  a compiler
  278. runs `as' automatically.  Warnings report an assumption made so that
  279. `as' could keep assembling a flawed program; errors report a grave
  280. problem that stops the assembly.
  281.  
  282.    Warning messages have the format
  283.  
  284.      file_name:NNN:Warning Message Text
  285.  
  286. (where NNN is a line number).  If a logical file name has been given
  287. (*note `.app-file': App-File.) it is used for the filename, otherwise
  288. the name of the current input file is used.  If a logical line number
  289. was given (*note `.line': Line.) then it is used to calculate the
  290. number printed, otherwise the actual line in the current source file
  291. is printed.  The message text is intended to be self explanatory (in
  292. the grand Unix tradition).
  293.  
  294.    Error messages have the format
  295.      file_name:NNN:FATAL:Error Message Text
  296.    The file name and line number are derived as for warning messages. 
  297. The actual message text may be rather less explanatory because many of
  298. them aren't supposed to happen.
  299.  
  300. 
  301. File: as.info,  Node: Invoking,  Next: Syntax,  Prev: Overview,  Up: Top
  302.  
  303. Command-Line Options
  304. ********************
  305.  
  306.    This chapter describes command-line options available in *all*
  307. versions of the GNU assembler; *note M68K-Dependent::., for options
  308. specific to the Motorola 680x0.
  309.  
  310. Enable Listings: `-a', `-al', `-as'
  311. ===================================
  312.  
  313.    These options enable listing output from the assembler.  `-a' by
  314. itself requests all listing output; `-al' requests only the
  315. output-program listing, and `-as' requests only a symbol table listing.
  316.  
  317.    Once you have specified one of these options, you can further
  318. control listing output and its appearance using the directives `.list',
  319. `.nolist', `.psize', `.eject', `.title', and `.sbttl'.
  320.  
  321.    If you do not request listing output with one of the `-a' options,
  322. the listing-control directives have no effect.
  323.  
  324. `-D'
  325. ====
  326.  
  327.    This option has no effect whatsoever, but it is accepted to make it
  328. more likely that scripts written for other assemblers will also work
  329. with `as'.
  330.  
  331. Work Faster: `-f'
  332. =================
  333.  
  334.    `-f' should only be used when assembling programs written by a
  335. (trusted) compiler.  `-f' stops the assembler from pre-processing the
  336. input file(s) before assembling them.  *Note Pre-processing:
  337. Pre-processing.
  338.  
  339.      *Warning:* if the files actually need to be pre-processed (if they
  340.      contain comments, for example), `as' will not work correctly if
  341.      `-f' is used.
  342.  
  343. `.include' search path: `-I' PATH
  344. =================================
  345.  
  346.    Use this option to add a PATH to the list of directories `as' will
  347. search for files specified in `.include' directives (*note `.include':
  348. Include.).  You may use `-I' as many times as necessary to include a
  349. variety of paths.  The current working directory is always searched
  350. first; after that, `as' searches any `-I' directories in the same
  351. order as they were specified (left to right) on the command line.
  352.  
  353. Difference Tables: `-k'
  354. =======================
  355.  
  356.    `as' sometimes alters the code emitted for directives of the form
  357. `.word SYM1-SYM2'; *note `.word': Word..  You can use the `-k' option
  358. if you want a warning issued when this is done.
  359.  
  360. Include Local Labels: `-L'
  361. ==========================
  362.  
  363.    Labels beginning with `L' (upper case only) are called "local
  364. labels". *Note Symbol Names::.  Normally you don't see such labels when
  365. debugging, because they are intended for the use of programs (like
  366. compilers) that compose assembler programs, not for your notice. 
  367. Normally both `as' and `ld' discard such labels, so you don't normally
  368. debug with them.
  369.  
  370.    This option tells `as' to retain those `L...' symbols in the object
  371. file.  Usually if you do this you also tell the linker `ld' to
  372. preserve symbols whose names begin with `L'.
  373.  
  374. Name the Object File: `-o'
  375. ==========================
  376.  
  377.    There is always one object file output when you run `as'.  By
  378. default it has the name `a.out'.  You use this option (which takes
  379. exactly one filename) to give the object file a different name.
  380.  
  381.    Whatever the object file is called, `as' will overwrite any
  382. existing file of the same name.
  383.  
  384. Join Data and Text Sections: `-R'
  385. =================================
  386.  
  387.    `-R' tells `as' to write the object file as if all data-section
  388. data lives in the text section.  This is only done at the very last
  389. moment:  your binary data are the same, but data section parts are
  390. relocated differently.  The data section part of your object file is
  391. zero bytes long because all it bytes are appended to the text section.
  392.  (*Note Sections and Relocation: Sections.)
  393.  
  394.    When you specify `-R' it would be possible to generate shorter
  395. address displacements (because we don't have to cross between text and
  396. data section).  We refrain from doing this simply for compatibility
  397. with older versions of `as'.  In future, `-R' may work this way.
  398.  
  399. Announce Version: `-v'
  400. ======================
  401.  
  402.    You can find out what version of as is running by including the
  403. option `-v' (which you can also spell as `-version') on the command
  404. line.
  405.  
  406. Suppress Warnings: `-W'
  407. =======================
  408.  
  409.    `as' should never give a warning or error message when assembling
  410. compiler output.  But programs written by people often cause `as' to
  411. give a warning that a particular assumption was made.  All such
  412. warnings are directed to the standard error file.  If you use this
  413. option, no warnings are issued.  This option only affects the warning
  414. messages: it does not change any particular of how `as' assembles your
  415. file.  Errors, which stop the assembly, are still reported.
  416.  
  417. 
  418. File: as.info,  Node: Syntax,  Next: Sections,  Prev: Invoking,  Up: Top
  419.  
  420. Syntax
  421. ******
  422.  
  423.    This chapter describes the machine-independent syntax allowed in a
  424. source file.  `as' syntax is similar to what many other assemblers
  425. use; it is inspired in BSD 4.2 assembler.
  426.  
  427. * Menu:
  428.  
  429. * Pre-processing::        Pre-processing
  430. * Whitespace::            Whitespace
  431. * Comments::            Comments
  432. * Symbol Intro::        Symbols
  433. * Statements::            Statements
  434. * Constants::            Constants
  435.  
  436. 
  437. File: as.info,  Node: Pre-processing,  Next: Whitespace,  Prev: Syntax,  Up: Syntax
  438.  
  439. Pre-Processing
  440. ==============
  441.  
  442.    The pre-processor:
  443.    * adjusts and removes extra whitespace.  It leaves one space or tab
  444.      before the keywords on a line, and turns any other whitespace on
  445.      the line into a single space.
  446.  
  447.    * removes all comments, replacing them with a single space, or an
  448.      appropriate number of newlines.
  449.  
  450.    * converts character constants into the appropriate numeric values.
  451.  
  452.    Excess whitespace, comments, and character constants cannot be used
  453. in the portions of the input text that are not pre-processed.
  454.  
  455.    If the first line of an input file is `#NO_APP' or the `-f' option
  456. is given, the input file will not be pre-processed.  Within such an
  457. input file, parts of the file can be pre-processed by putting a line
  458. that says `#APP' before the text that should be pre-processed, and
  459. putting a line that says `#NO_APP' after them.  This feature is mainly
  460. intend to support `asm' statements in compilers whose output normally
  461. does not need to be pre-processed.
  462.  
  463. 
  464. File: as.info,  Node: Whitespace,  Next: Comments,  Prev: Pre-processing,  Up: Syntax
  465.  
  466. Whitespace
  467. ==========
  468.  
  469.    "Whitespace" is one or more blanks or tabs, in any order. 
  470. Whitespace is used to separate symbols, and to make programs neater for
  471. people to read.  Unless within character constants (*note Character
  472. Constants: Characters.), any whitespace means the same as exactly one
  473. space.
  474.  
  475. 
  476. File: as.info,  Node: Comments,  Next: Symbol Intro,  Prev: Whitespace,  Up: Syntax
  477.  
  478. Comments
  479. ========
  480.  
  481.    There are two ways of rendering comments to `as'.  In both cases
  482. the comment is equivalent to one space.
  483.  
  484.    Anything from `/*' through the next `*/' is a comment.  This means
  485. you may not nest these comments.
  486.  
  487.      /*
  488.        The only way to include a newline ('\n') in a comment
  489.        is to use this sort of comment.
  490.      */
  491.      
  492.      /* This sort of comment does not nest. */
  493.  
  494.    Anything from the "line comment" character to the next newline is
  495. considered a comment and is ignored.  The line comment character is
  496. `|' on the 680x0; *note M68K-Dependent::..
  497.  
  498.    To be compatible with past assemblers, a special interpretation is
  499. given to lines that begin with `#'.  Following the `#' an absolute
  500. expression (*note Expressions::.) is expected:  this will be the
  501. logical line number of the next line.  Then a string (*Note
  502. Strings::.) is allowed: if present it is a new logical file name.  The
  503. rest of the line, if any, should be whitespace.
  504.  
  505.    If the first non-whitespace characters on the line are not numeric,
  506. the line is ignored.  (Just like a comment.)
  507.                                # This is an ordinary comment.
  508.      # 42-6 "new_file_name"    # New logical file name
  509.                                # This is logical line # 36.
  510.    This feature is deprecated, and may disappear from future versions
  511. of `as'.
  512.  
  513. 
  514. File: as.info,  Node: Symbol Intro,  Next: Statements,  Prev: Comments,  Up: Syntax
  515.  
  516. Symbols
  517. =======
  518.  
  519.    A "symbol" is one or more characters chosen from the set of all
  520. letters (both upper and lower case), digits and the three characters
  521. `_.$' No symbol may begin with a digit.  Case is significant.  There
  522. is no length limit: all characters are significant.  Symbols are
  523. delimited by characters not in that set, or by the beginning of a file
  524. (since the source program must end with a newline, the end of a file is
  525. not a possible symbol delimiter).  *Note Symbols::.
  526.  
  527. 
  528. File: as.info,  Node: Statements,  Next: Constants,  Prev: Symbol Intro,  Up: Syntax
  529.  
  530. Statements
  531. ==========
  532.  
  533.    A "statement" ends at a newline character (`\n') or at a semicolon
  534. (`;').  The newline or semicolon is considered part of the preceding
  535. statement.  Newlines and semicolons within character constants are an
  536. exception: they don't end statements.
  537.  
  538.    It is an error to end any statement with end-of-file:  the last
  539. character of any input file should be a newline.
  540.  
  541.    You may write a statement on more than one line if you put a
  542. backslash (`\') immediately in front of any newlines within the
  543. statement.  When `as' reads a backslashed newline both characters are
  544. ignored.  You can even put backslashed newlines in the middle of
  545. symbol names without changing the meaning of your source program.
  546.  
  547.    An empty statement is allowed, and may include whitespace.  It is
  548. ignored.
  549.  
  550.    A statement begins with zero or more labels, optionally followed by
  551. a key symbol which determines what kind of statement it is.  The key
  552. symbol determines the syntax of the rest of the statement.  If the
  553. symbol begins with a dot `.' then the statement is an assembler
  554. directive: typically valid for any computer.  If the symbol begins with
  555. a letter the statement is an assembly language "instruction": it will
  556. assemble into a machine language instruction.
  557.  
  558.    A label is a symbol immediately followed by a colon (`:'). 
  559. Whitespace before a label or after a colon is permitted, but you may
  560. not have whitespace between a label's symbol and its colon. *Note
  561. Labels::.
  562.  
  563.      label:     .directive    followed by something
  564.      another_label:           # This is an empty statement.
  565.                 instruction   operand_1, operand_2, ...
  566.  
  567. 
  568. File: as.info,  Node: Constants,  Prev: Statements,  Up: Syntax
  569.  
  570. Constants
  571. =========
  572.  
  573.    A constant is a number, written so that its value is known by
  574. inspection, without knowing any context.  Like this:
  575.      .byte  74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
  576.      .ascii "Ring the bell\7"                  # A string constant.
  577.      .octa  0x123456789abcdef0123456789ABCDEF0 # A bignum.
  578.      .float 0f-314159265358979323846264338327\
  579.      95028841971.693993751E-40                 # - pi, a flonum.
  580.  
  581. * Menu:
  582.  
  583. * Characters::            Character Constants
  584. * Numbers::            Number Constants
  585.  
  586. 
  587. File: as.info,  Node: Characters,  Next: Numbers,  Prev: Constants,  Up: Constants
  588.  
  589. Character Constants
  590. -------------------
  591.  
  592.    There are two kinds of character constants.  A "character" stands
  593. for one character in one byte and its value may be used in numeric
  594. expressions.  String constants (properly called string *literals*) are
  595. potentially many bytes and their values may not be used in arithmetic
  596. expressions.
  597.  
  598. * Menu:
  599.  
  600. * Strings::            Strings
  601. * Chars::            Characters
  602.  
  603. 
  604. File: as.info,  Node: Strings,  Next: Chars,  Prev: Characters,  Up: Characters
  605.  
  606. Strings
  607. .......
  608.  
  609.    A "string" is written between double-quotes.  It may contain
  610. double-quotes or null characters.  The way to get special characters
  611. into a string is to "escape" these characters: precede them with a
  612. backslash `\' character.  For example `\\' represents one backslash: 
  613. the first `\' is an escape which tells `as' to interpret the second
  614. character literally as a backslash (which prevents `as' from
  615. recognizing the second `\' as an escape character).  The complete list
  616. of escapes follows.
  617.  
  618. `\b'
  619.      Mnemonic for backspace; for ASCII this is octal code 010.
  620.  
  621. `\f'
  622.      Mnemonic for FormFeed; for ASCII this is octal code 014.
  623.  
  624. `\n'
  625.      Mnemonic for newline; for ASCII this is octal code 012.
  626.  
  627. `\r'
  628.      Mnemonic for carriage-Return; for ASCII this is octal code 015.
  629.  
  630. `\t'
  631.      Mnemonic for horizontal Tab; for ASCII this is octal code 011.
  632.  
  633. `\ DIGIT DIGIT DIGIT'
  634.      An octal character code.  The numeric code is 3 octal digits. 
  635.      For compatibility with other Unix systems, 8 and 9 are accepted
  636.      as digits: for example, `\008' has the value 010, and `\009' the
  637.      value 011.
  638.  
  639. `\\'
  640.      Represents one `\' character.
  641.  
  642. `\"'
  643.      Represents one `"' character.  Needed in strings to represent
  644.      this character, because an unescaped `"' would end the string.
  645.  
  646. `\ ANYTHING-ELSE'
  647.      Any other character when escaped by `\' will give a warning, but
  648.      assemble as if the `\' was not present.  The idea is that if you
  649.      used an escape sequence you clearly didn't want the literal
  650.      interpretation of the following character.  However `as' has no
  651.      other interpretation, so `as' knows it is giving you the wrong
  652.      code and warns you of the fact.
  653.  
  654.    Which characters are escapable, and what those escapes represent,
  655. varies widely among assemblers.  The current set is what we think the
  656. BSD 4.2 assembler recognizes, and is a subset of what most C compilers
  657. recognize.  If you are in doubt, don't use an escape sequence.
  658.  
  659. 
  660. File: as.info,  Node: Chars,  Prev: Strings,  Up: Characters
  661.  
  662. Characters
  663. ..........
  664.  
  665.    A single character may be written as a single quote immediately
  666. followed by that character.  The same escapes apply to characters as
  667. to strings.  So if you want to write the character backslash, you must
  668. write `'\\' where the first `\' escapes the second `\'.  As you can
  669. see, the quote is an acute accent, not a grave accent.  A newline (or
  670. semicolon `;') immediately following an acute accent is taken as a
  671. literal character and does not count as the end of a statement.  The
  672. value of a character constant in a numeric expression is the machine's
  673. byte-wide code for that character.  `as' assumes your character code
  674. is ASCII: `'A' means 65, `'B' means 66, and so on.
  675.  
  676. 
  677. File: as.info,  Node: Numbers,  Prev: Characters,  Up: Constants
  678.  
  679. Number Constants
  680. ----------------
  681.  
  682.    `as' distinguishes three kinds of numbers according to how they are
  683. stored in the target machine.  *Integers* are numbers that would fit
  684. into an `int' in the C language.  *Bignums* are integers, but they are
  685. stored in more than 32 bits.  *Flonums* are floating point numbers,
  686. described below.
  687.  
  688. * Menu:
  689.  
  690. * Integers::            Integers
  691. * Bignums::            Bignums
  692. * Flonums::            Flonums
  693.  
  694. 
  695. File: as.info,  Node: Integers,  Next: Bignums,  Prev: Numbers,  Up: Numbers
  696.  
  697. Integers
  698. ........
  699.  
  700.    A binary integer is `0b' or `0B' followed by zero or more of the
  701. binary digits `01'.
  702.  
  703.    An octal integer is `0' followed by zero or more of the octal
  704. digits (`01234567').
  705.  
  706.    A decimal integer starts with a non-zero digit followed by zero or
  707. more digits (`0123456789').
  708.  
  709.    A hexadecimal integer is `0x' or `0X' followed by one or more
  710. hexadecimal digits chosen from `0123456789abcdefABCDEF'.
  711.  
  712.    Integers have the usual values.  To denote a negative integer, use
  713. the prefix operator `-' discussed under expressions (*note Prefix
  714. Operators: Prefix Ops.).
  715.  
  716. 
  717. File: as.info,  Node: Bignums,  Next: Flonums,  Prev: Integers,  Up: Numbers
  718.  
  719. Bignums
  720. .......
  721.  
  722.    A "bignum" has the same syntax and semantics as an integer except
  723. that the number (or its negative) takes more than 32 bits to represent
  724. in binary.  The distinction is made because in some places integers
  725. are permitted while bignums are not.
  726.  
  727. 
  728. File: as.info,  Node: Flonums,  Prev: Bignums,  Up: Numbers
  729.  
  730. Flonums
  731. .......
  732.  
  733.    A "flonum" represents a floating point number.  The translation is
  734. indirect: a decimal floating point number from the text is converted by
  735. `as' to a generic binary floating point number of more than sufficient
  736. precision.  This generic floating point number is converted to a
  737. particular computer's floating point format (or formats) by a portion
  738. of `as' specialized to that computer.
  739.  
  740.    A flonum is written by writing (in order)
  741.    * The digit `0'.
  742.  
  743.    * A letter, to tell `as' the rest of the number is a flonum.
  744.  
  745.    * An optional sign: either `+' or `-'.
  746.  
  747.    * An optional "integer part": zero or more decimal digits.
  748.  
  749.    * An optional "fractional part": `.' followed by zero or more
  750.      decimal digits.
  751.  
  752.    * An optional exponent, consisting of:
  753.         * An `E' or `e'.
  754.  
  755.         * Optional sign: either `+' or `-'.
  756.  
  757.         * One or more decimal digits.
  758.  
  759.    At least one of the integer part or the fractional part must be
  760. present.  The floating point number has the usual base-10 value.
  761.  
  762.    `as' does all processing using integers.  Flonums are computed
  763. independently of any floating point hardware in the computer running
  764. `as'.
  765.  
  766. 
  767. File: as.info,  Node: Sections,  Next: Symbols,  Prev: Syntax,  Up: Top
  768.  
  769. Sections and Relocation
  770. ***********************
  771.  
  772. * Menu:
  773.  
  774. * Secs Background::        Background
  775. * ld Sections::        ld Sections
  776. * as Sections::        as Internal Sections
  777. * Sub-Sections::        Sub-Sections
  778. * bss::                bss Section
  779.  
  780. 
  781. File: as.info,  Node: Secs Background,  Next: ld Sections,  Prev: Sections,  Up: Sections
  782.  
  783. Background
  784. ==========
  785.  
  786.    Roughly, a section is a range of addresses, with no gaps; all data
  787. "in" those addresses is treated the same for some particular purpose. 
  788. For example there may be a "read only" section.
  789.  
  790.    The linker `ld' reads many object files (partial programs) and
  791. combines their contents to form a runnable program.  When `as' emits
  792. an object file, the partial program is assumed to start at address 0. 
  793. `ld' will assign the final addresses the partial program occupies, so
  794. that different partial programs don't overlap.  This is actually an
  795. over-simplification, but it will suffice to explain how `as' uses
  796. sections.
  797.  
  798.    `ld' moves blocks of bytes of your program to their run-time
  799. addresses.  These blocks slide to their run-time addresses as rigid
  800. units; their length does not change and neither does the order of bytes
  801. within them.  Such a rigid unit is called a *section*.  Assigning
  802. run-time addresses to sections is called "relocation".  It includes
  803. the task of adjusting mentions of object-file addresses so they refer
  804. to the proper run-time addresses.
  805.  
  806.    An object file written by `as' has at least three sections, any of
  807. which may be empty.  These are named "text", "data" and "bss" sections.
  808.  
  809.    Within the object file, the text section starts at address `0', the
  810. data section follows, and the bss section follows the data section.
  811.  
  812.    To let `ld' know which data will change when the sections are
  813. relocated, and how to change that data, `as' also writes to the object
  814. file details of the relocation needed.  To perform relocation `ld'
  815. must know, each time an address in the object file is mentioned:
  816.    * Where in the object file is the beginning of this reference to an
  817.      address?
  818.  
  819.    * How long (in bytes) is this reference?
  820.  
  821.    * Which section does the address refer to?  What is the numeric
  822.      value of
  823.           (ADDRESS) - (START-ADDRESS OF SECTION)?
  824.  
  825.    * Is the reference to an address "Program-Counter relative"?
  826.  
  827.    In fact, every address `as' ever uses is expressed as
  828.      (SECTION) + (OFFSET INTO SECTION)
  829.  
  830. Further, every expression `as' computes is of this section-relative
  831. nature.  "Absolute expression" means an expression with section
  832. "absolute" (*note ld Sections::.).  A "pass1 expression" means an
  833. expression with section "pass1" (*note as Internal Sections: as
  834. Sections.).  In this manual we use the notation {SECNAME N} to mean
  835. "offset N into section SECNAME".
  836.  
  837.    Apart from text, data and bss sections you need to know about the
  838. "absolute" section.  When `ld' mixes partial programs, addresses in
  839. the absolute section remain unchanged.  For example, address
  840. `{absolute 0}' is "relocated" to run-time address 0 by `ld'.  Although
  841. two partial programs' data sections will not overlap addresses after
  842. linking, *by definition* their absolute sections will overlap. 
  843. Address `{absolute 239}' in one partial program will always be the same
  844. address when the program is running as address `{absolute 239}' in any
  845. other partial program.
  846.  
  847.    The idea of sections is extended to the "undefined" section.  Any
  848. address whose section is unknown at assembly time is by definition
  849. rendered {undefined U}--where U will be filled in later.  Since
  850. numbers are always defined, the only way to generate an undefined
  851. address is to mention an undefined symbol.  A reference to a named
  852. common block would be such a symbol: its value is unknown at assembly
  853. time so it has section *undefined*.
  854.  
  855.    By analogy the word *section* is used to describe groups of
  856. sections in the linked program.  `ld' puts all partial programs' text
  857. sections in contiguous addresses in the linked program.  It is
  858. customary to refer to the *text section* of a program, meaning all the
  859. addresses of all partial program's text sections.  Likewise for data
  860. and bss sections.
  861.  
  862.    Some sections are manipulated by `ld'; others are invented for use
  863. of `as' and have no meaning except during assembly.
  864.  
  865. 
  866. File: as.info,  Node: ld Sections,  Next: as Sections,  Prev: Secs Background,  Up: Sections
  867.  
  868. ld Sections
  869. ===========
  870.  
  871.    `ld' deals with just four kinds of sections, summarized below.
  872.  
  873. *text section*
  874. *data section*
  875.      These sections hold your program.  `as' and `ld' treat them as
  876.      separate but equal sections.  Anything you can say of one section
  877.      is true another.  When the program is running, however, it is
  878.      customary for the text section to be unalterable.  The text
  879.      section is often shared among processes: it will contain
  880.      instructions, constants and the like.  The data section of a
  881.      running program is usually alterable: for example, C variables
  882.      would be stored in the data section.
  883.  
  884. *bss section*
  885.      This section contains zeroed bytes when your program begins
  886.      running.  It is used to hold unitialized variables or common
  887.      storage.  The length of each partial program's bss section is
  888.      important, but because it starts out containing zeroed bytes
  889.      there is no need to store explicit zero bytes in the object file.
  890.       The bss section was invented to eliminate those explicit zeros
  891.      from object files.
  892.  
  893. *absolute section*
  894.      Address 0 of this section is always "relocated" to runtime
  895.      address 0.  This is useful if you want to refer to an address
  896.      that `ld' must not change when relocating.  In this sense we
  897.      speak of absolute addresses being "unrelocatable": they don't
  898.      change during relocation.
  899.  
  900. *undefined section*
  901.      This "section" is a catch-all for address references to objects
  902.      not in the preceding sections.
  903.  
  904.    An idealized example of three relocatable sections follows.  Memory
  905. addresses are on the horizontal axis.
  906.  
  907.                            +-----+----+--+
  908.      partial program # 1:  |ttttt|dddd|00|
  909.                            +-----+----+--+
  910.      
  911.                            text   data bss
  912.                            seg.   seg. seg.
  913.      
  914.                            +---+---+---+
  915.      partial program # 2:  |TTT|DDD|000|
  916.                            +---+---+---+
  917.      
  918.                            +--+---+-----+--+----+---+-----+~~
  919.      linked program:       |  |TTT|ttttt|  |dddd|DDD|00000|
  920.                            +--+---+-----+--+----+---+-----+~~
  921.      
  922.          addresses:        0 ...
  923.  
  924. 
  925. File: as.info,  Node: as Sections,  Next: Sub-Sections,  Prev: ld Sections,  Up: Sections
  926.  
  927. as Internal Sections
  928. ====================
  929.  
  930.    These sections are meant only for the internal use of `as'.  They
  931. have no meaning at run-time.  You don't really need to know about these
  932. sections for most purposes; but they can be mentioned in `as' warning
  933. messages, so it might be helpful to have an idea of their meanings to
  934. `as'.  These sections are used to permit the value of every expression
  935. in your assembly language program to be a section-relative address.
  936.  
  937. absent
  938.      An expression was expected and none was found.
  939.  
  940. ASSEMBLER-INTERNAL-LOGIC-ERROR!
  941.      An internal assembler logic error has been found.  This means
  942.      there is a bug in the assembler.
  943.  
  944. bignum/flonum
  945.      If a number can't be written as a C `int' constant (a bignum or a
  946.      flonum, but not an integer), it is recorded as belonging to this
  947.      "section".  `as' has to remember that a flonum or a bignum does
  948.      not fit into 32 bits, and cannot be an argument (*note
  949.      Arguments::.) in an expression: this is done by making a flonum
  950.      or bignum be in a separate internal section.  This is purely for
  951.      internal `as' convenience; bignum/flonum section behaves
  952.      similarly to absolute section.
  953.  
  954. pass1 section
  955.      The expression was impossible to evaluate in the first pass.  The
  956.      assembler will attempt a second pass (second reading of the
  957.      source) to evaluate the expression.  Your expression mentioned an
  958.      undefined symbol in a way that defies the one-pass (section +
  959.      offset in section) assembly process.  No compiler need emit such
  960.      an expression.
  961.  
  962.           *Warning:* the second pass is currently not implemented. 
  963.           `as' will abort with an error message if one is required.
  964.  
  965. difference section
  966.      As an assist to the C compiler, expressions of the forms
  967.              (UNDEFINED SYMBOL) - (EXPRESSION)
  968.              SOMETHING - (UNDEFINED SYMBOL)
  969.              (UNDEFINED SYMBOL) - (UNDEFINED SYMBOL)
  970.  
  971.      are permitted, and belong to the difference section.  `as'
  972.      re-evaluates such expressions after the source file has been read
  973.      and the symbol table built.  If by that time there are no
  974.      undefined symbols in the expression then the expression assumes a
  975.      new section.  The intention is to permit statements like `.word
  976.      label - base_of_table' to be assembled in one pass where both
  977.      `label' and `base_of_table' are undefined.  This is useful for
  978.      compiling C and Algol switch statements, Pascal case statements,
  979.      FORTRAN computed goto statements and the like.
  980.  
  981. 
  982. File: as.info,  Node: Sub-Sections,  Next: bss,  Prev: as Sections,  Up: Sections
  983.  
  984. Sub-Sections
  985. ============
  986.  
  987.    Assembled bytes fall into two sections: text and data.  You may
  988. have separate groups of text or data that you want to end up near to
  989. each other in the object file, even though they are not contiguous in
  990. the assembler source.  `as' allows you to use "subsections" for this
  991. purpose.  Within each section, there can be numbered subsections with
  992. values from 0 to 8192.  Objects assembled into the same subsection will
  993. be grouped with other objects in the same subsection when they are all
  994. put into the object file.  For example, a compiler might want to store
  995. constants in the text section, but might not want to have them
  996. interspersed with the program being assembled.  In this case, the
  997. compiler could issue a `.text 0' before each section of code being
  998. output, and a `.text 1' before each group of constants being output.
  999.  
  1000.    Subsections are optional.  If you don't use subsections, everything
  1001. will be stored in subsection number zero.
  1002.  
  1003.    Subsections appear in your object file in numeric order, lowest
  1004. numbered to highest.  (All this to be compatible with other people's
  1005. assemblers.) The object file contains no representation of
  1006. subsections; `ld' and other programs that manipulate object files will
  1007. see no trace of them.  They just see all your text subsections as a
  1008. text section, and all your data subsections as a data section.
  1009.  
  1010.    To specify which subsection you want subsequent statements assembled
  1011. into, use a numeric argument to specify it, in a `.text EXPRESSION' or
  1012. a `.data EXPRESSION' statement.  EXPRESSION should be an absolute
  1013. expression.  (*Note Expressions::.)  If you just say `.text' then
  1014. `.text 0' is assumed.  Likewise `.data' means `.data 0'.  Assembly
  1015. begins in `text 0'.  For instance:
  1016.      .text 0     # The default subsection is text 0 anyway.
  1017.      .ascii "This lives in the first text subsection. *"
  1018.      .text 1
  1019.      .ascii "But this lives in the second text subsection."
  1020.      .data 0
  1021.      .ascii "This lives in the data section,"
  1022.      .ascii "in the first data subsection."
  1023.      .text 0
  1024.      .ascii "This lives in the first text section,"
  1025.      .ascii "immediately following the asterisk (*)."
  1026.  
  1027.    Each section has a "location counter" incremented by one for every
  1028. byte assembled into that section.  Because subsections are merely a
  1029. convenience restricted to `as' there is no concept of a subsection
  1030. location counter.  There is no way to directly manipulate a location
  1031. counter--but the `.align' directive will change it, and any label
  1032. definition will capture its current value.  The location counter of the
  1033. section that statements are being assembled into is said to be the
  1034. "active" location counter.
  1035.  
  1036. 
  1037. File: as.info,  Node: bss,  Prev: Sub-Sections,  Up: Sections
  1038.  
  1039. bss Section
  1040. ===========
  1041.  
  1042.    The bss section is used for local common variable storage.  You may
  1043. allocate address space in the bss section, but you may not dictate
  1044. data to load into it before your program executes.  When your program
  1045. starts running, all the contents of the bss section are zeroed bytes.
  1046.  
  1047.    Addresses in the bss section are allocated with special directives;
  1048. you may not assemble anything directly into the bss section.  Hence
  1049. there are no bss subsections. *Note `.comm': Comm, *note `.lcomm':
  1050. Lcomm..
  1051.  
  1052. 
  1053. File: as.info,  Node: Symbols,  Next: Expressions,  Prev: Sections,  Up: Top
  1054.  
  1055. Symbols
  1056. *******
  1057.  
  1058.    Symbols are a central concept: the programmer uses symbols to name
  1059. things, the linker uses symbols to link, and the debugger uses symbols
  1060. to debug.
  1061.  
  1062.      *Warning:* `as' does not place symbols in the object file in the
  1063.      same order they were declared.  This may break some debuggers.
  1064.  
  1065. * Menu:
  1066.  
  1067. * Labels::            Labels
  1068. * Setting Symbols::        Giving Symbols Other Values
  1069. * Symbol Names::        Symbol Names
  1070. * Dot::                The Special Dot Symbol
  1071. * Symbol Attributes::        Symbol Attributes
  1072.  
  1073. 
  1074. File: as.info,  Node: Labels,  Next: Setting Symbols,  Prev: Symbols,  Up: Symbols
  1075.  
  1076. Labels
  1077. ======
  1078.  
  1079.    A "label" is written as a symbol immediately followed by a colon
  1080. `:'.  The symbol then represents the current value of the active
  1081. location counter, and is, for example, a suitable instruction operand.
  1082.  You are warned if you use the same symbol to represent two different
  1083. locations: the first definition overrides any other definitions.
  1084.  
  1085. 
  1086. File: as.info,  Node: Setting Symbols,  Next: Symbol Names,  Prev: Labels,  Up: Symbols
  1087.  
  1088. Giving Symbols Other Values
  1089. ===========================
  1090.  
  1091.    A symbol can be given an arbitrary value by writing a symbol,
  1092. followed by an equals sign `=', followed by an expression (*note
  1093. Expressions::.).  This is equivalent to using the `.set' directive. 
  1094. *Note `.set': Set.
  1095.  
  1096. 
  1097. File: as.info,  Node: Symbol Names,  Next: Dot,  Prev: Setting Symbols,  Up: Symbols
  1098.  
  1099. Symbol Names
  1100. ============
  1101.  
  1102.    Symbol names begin with a letter or with one of `_.$' That
  1103. character may be followed by any string of digits, letters,
  1104. underscores and dollar signs.  Case of letters is significant: `foo'
  1105. is a different symbol name than `Foo'.
  1106.  
  1107.    Each symbol has exactly one name. Each name in an assembly language
  1108. program refers to exactly one symbol. You may use that symbol name any
  1109. number of times in a program.
  1110.  
  1111. Local Symbol Names
  1112. ------------------
  1113.  
  1114.    Local symbols help compilers and programmers use names temporarily. 
  1115. There are ten local symbol names, which are re-used throughout the
  1116. program.  You may refer to them using the names `0' `1' ... `9'.  To
  1117. define a local symbol, write a label of the form `N:' (where N
  1118. represents any digit).  To refer to the most recent previous
  1119. definition of that symbol write `Nb', using the same digit as when you
  1120. defined the label.  To refer to the next definition of a local label,
  1121. write `Nf'--where N gives you a choice of 10 forward references.  The
  1122. `b' stands for "backwards" and the `f' stands for "forwards".
  1123.  
  1124.    Local symbols are not emitted by the current GNU C compiler.
  1125.  
  1126.    There is no restriction on how you can use these labels, but
  1127. remember that at any point in the assembly you can refer to at most 10
  1128. prior local labels and to at most 10 forward local labels.
  1129.  
  1130.    Local symbol names are only a notation device.  They are immediately
  1131. transformed into more conventional symbol names before the assembler
  1132. uses them.  The symbol names stored in the symbol table, appearing in
  1133. error messages and optionally emitted to the object file have these
  1134. parts:
  1135.  
  1136. `L'
  1137.      All local labels begin with `L'. Normally both `as' and `ld'
  1138.      forget symbols that start with `L'. These labels are used for
  1139.      symbols you are never intended to see.  If you give the `-L'
  1140.      option then `as' will retain these symbols in the object file. If
  1141.      you also instruct `ld' to retain these symbols, you may use them
  1142.      in debugging.
  1143.  
  1144. `DIGIT'
  1145.      If the label is written `0:' then the digit is `0'.  If the label
  1146.      is written `1:' then the digit is `1'.  And so on up through `9:'.
  1147.  
  1148. A'
  1149.      This unusual character is included so you don't accidentally
  1150.      invent a symbol of the same name.  The character has ASCII value
  1151.      `\001'.
  1152.  
  1153. `*ordinal number*'
  1154.      This is a serial number to keep the labels distinct.  The first
  1155.      `0:' gets the number `1'; The 15th `0:' gets the number `15';
  1156.      *etc.*.  Likewise for the other labels `1:' through `9:'.
  1157.  
  1158.    For instance, the first `1:' is named `LA1', the 44th `3:' is
  1159. named `LA44'.
  1160.  
  1161. 
  1162. File: as.info,  Node: Dot,  Next: Symbol Attributes,  Prev: Symbol Names,  Up: Symbols
  1163.  
  1164. The Special Dot Symbol
  1165. ======================
  1166.  
  1167.    The special symbol `.' refers to the current address that `as' is
  1168. assembling into.  Thus, the expression `melvin: .long .' will cause
  1169. `melvin' to contain its own address.  Assigning a value to `.' is
  1170. treated the same as a `.org' directive.  Thus, the expression `.=.+4'
  1171. is the same as saying `.space 4'.
  1172.  
  1173. 
  1174. File: as.info,  Node: Symbol Attributes,  Prev: Dot,  Up: Symbols
  1175.  
  1176. Symbol Attributes
  1177. =================
  1178.  
  1179.    Every symbol has, as well as its name, the attributes "Value" and
  1180. "Type".  Depending on output format, symbols can also have auxiliary
  1181. attributes.
  1182.  
  1183.    If you use a symbol without defining it, `as' assumes zero for all
  1184. these attributes, and probably won't warn you.  This makes the symbol
  1185. an externally defined symbol, which is generally what you would want.
  1186.  
  1187. * Menu:
  1188.  
  1189. * Symbol Value::        Value
  1190. * Symbol Type::            Type
  1191. * a.out Symbols::        Symbol Attributes: `a.out'
  1192.  
  1193. 
  1194. File: as.info,  Node: Symbol Value,  Next: Symbol Type,  Prev: Symbol Attributes,  Up: Symbol Attributes
  1195.  
  1196. Value
  1197. -----
  1198.  
  1199.    The value of a symbol is (usually) 32 bits.  For a symbol which
  1200. labels a location in the text, data, bss or absolute sections the
  1201. value is the number of addresses from the start of that section to the
  1202. label.  Naturally for text, data and bss sections the value of a
  1203. symbol changes as `ld' changes section base addresses during linking. 
  1204. Absolute symbols' values do not change during linking: that is why
  1205. they are called absolute.
  1206.  
  1207.    The value of an undefined symbol is treated in a special way.  If
  1208. it is 0 then the symbol is not defined in this assembler source
  1209. program, and `ld' will try to determine its value from other programs
  1210. it is linked with.  You make this kind of symbol simply by mentioning
  1211. a symbol name without defining it.  A non-zero value represents a
  1212. `.comm' common declaration.  The value is how much common storage to
  1213. reserve, in bytes (addresses).  The symbol refers to the first address
  1214. of the allocated storage.
  1215.  
  1216. 
  1217. File: as.info,  Node: Symbol Type,  Next: a.out Symbols,  Prev: Symbol Value,  Up: Symbol Attributes
  1218.  
  1219. Type
  1220. ----
  1221.  
  1222.    The type attribute of a symbol contains relocation (section)
  1223. information, any flag settings indicating that a symbol is external,
  1224. and (optionally), other information for linkers and debuggers.  The
  1225. exact format depends on the object-code output format in use.
  1226.  
  1227. 
  1228. File: as.info,  Node: a.out Symbols,  Prev: Symbol Type,  Up: Symbol Attributes
  1229.  
  1230. Symbol Attributes: `a.out'
  1231. --------------------------
  1232.  
  1233. * Menu:
  1234.  
  1235. * Symbol Desc::            Descriptor
  1236. * Symbol Other::        Other
  1237.  
  1238. 
  1239. File: as.info,  Node: Symbol Desc,  Next: Symbol Other,  Prev: a.out Symbols,  Up: a.out Symbols
  1240.  
  1241. Descriptor
  1242. ..........
  1243.  
  1244.    This is an arbitrary 16-bit value.  You may establish a symbol's
  1245. descriptor value by using a `.desc' statement (*note `.desc': Desc.). 
  1246. A descriptor value means nothing to `as'.
  1247.  
  1248. 
  1249. File: as.info,  Node: Symbol Other,  Prev: Symbol Desc,  Up: a.out Symbols
  1250.  
  1251. Other
  1252. .....
  1253.  
  1254.    This is an arbitrary 8-bit value.  It means nothing to `as'.
  1255.  
  1256. 
  1257. File: as.info,  Node: Expressions,  Next: Pseudo Ops,  Prev: Symbols,  Up: Top
  1258.  
  1259. Expressions
  1260. ***********
  1261.  
  1262.    An "expression" specifies an address or numeric value.  Whitespace
  1263. may precede and/or follow an expression.
  1264.  
  1265. * Menu:
  1266.  
  1267. * Empty Exprs::            Empty Expressions
  1268. * Integer Exprs::        Integer Expressions
  1269.  
  1270. 
  1271. File: as.info,  Node: Empty Exprs,  Next: Integer Exprs,  Prev: Expressions,  Up: Expressions
  1272.  
  1273. Empty Expressions
  1274. =================
  1275.  
  1276.    An empty expression has no value: it is just whitespace or null. 
  1277. Wherever an absolute expression is required, you may omit the
  1278. expression and `as' will assume a value of (absolute) 0.  This is
  1279. compatible with other assemblers.
  1280.  
  1281. 
  1282. File: as.info,  Node: Integer Exprs,  Prev: Empty Exprs,  Up: Expressions
  1283.  
  1284. Integer Expressions
  1285. ===================
  1286.  
  1287.    An "integer expression" is one or more *arguments* delimited by
  1288. *operators*.
  1289.  
  1290. * Menu:
  1291.  
  1292. * Arguments::            Arguments
  1293. * Operators::            Operators
  1294. * Prefix Ops::            Prefix Operators
  1295. * Infix Ops::            Infix Operators
  1296.  
  1297. 
  1298. File: as.info,  Node: Arguments,  Next: Operators,  Prev: Integer Exprs,  Up: Integer Exprs
  1299.  
  1300. Arguments
  1301. ---------
  1302.  
  1303.    "Arguments" are symbols, numbers or subexpressions.  In other
  1304. contexts arguments are sometimes called "arithmetic operands".  In
  1305. this manual, to avoid confusing them with the "instruction operands" of
  1306. the machine language, we use the term "argument" to refer to parts of
  1307. expressions only, reserving the word "operand" to refer only to machine
  1308. instruction operands.
  1309.  
  1310.    Symbols are evaluated to yield {SECTION NNN} where SECTION is one
  1311. of text, data, bss, absolute, or undefined.  NNN is a signed, 2's
  1312. complement 32 bit integer.
  1313.  
  1314.    Numbers are usually integers.
  1315.  
  1316.    A number can be a flonum or bignum.  In this case, you are warned
  1317. that only the low order 32 bits are used, and `as' pretends these 32
  1318. bits are an integer.  You may write integer-manipulating instructions
  1319. that act on exotic constants, compatible with other assemblers.
  1320.  
  1321.    Subexpressions are a left parenthesis `(' followed by an integer
  1322. expression, followed by a right parenthesis `)'; or a prefix operator
  1323. followed by an argument.
  1324.  
  1325. 
  1326. File: as.info,  Node: Operators,  Next: Prefix Ops,  Prev: Arguments,  Up: Integer Exprs
  1327.  
  1328. Operators
  1329. ---------
  1330.  
  1331.    "Operators" are arithmetic functions, like `+' or `%'.  Prefix
  1332. operators are followed by an argument.  Infix operators appear between
  1333. their arguments.  Operators may be preceded and/or followed by
  1334. whitespace.
  1335.  
  1336. 
  1337. File: as.info,  Node: Prefix Ops,  Next: Infix Ops,  Prev: Operators,  Up: Integer Exprs
  1338.  
  1339. Prefix Operator
  1340. ---------------
  1341.  
  1342.    `as' has the following "prefix operators".  They each take one
  1343. argument, which must be absolute.
  1344.  
  1345. `-'
  1346.      "Negation".  Two's complement negation.
  1347.  
  1348. `~'
  1349.      "Complementation".  Bitwise not.
  1350.  
  1351.